package cn.group.service.impl;
import cn.group.mapper.AccountMapper;
import cn.group.service.AccountService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.entity.Account;

import java.util.List;

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public void save(Account account) {
        accountMapper.save(account);
    }

    @Override
    public List<Account> findAll() {
        PageHelper.startPage(1,2);
        return accountMapper.findAll();
    }

    @Override
    public void update(Account account) {
        accountMapper.update(account);
    }

    @Override
    public void delete(int id) {
        accountMapper.delete(id);
    }
}
